LUA_VERSION = _5_4
LUA_VER := $(subst _,.,$(patsubst _%,%,$(LUA_VERSION)))

TCC_STATIC = /usr/local/lib/libtcc.a /usr/local/lib/tcc/libtcc1.a

CFLAGS += -D$(LUA_VERSION)

.PHONY: clean_autotcc

autotcc: lib/autotcc.so

lib/autotcc.so : src/autotcc.o
	$(CC) -Wl,--no-eh-frame-hdr -shared -o $@ $^ -llua$(LUA_VER) $(TCC_STATIC)

clean_autotcc:
	-@rm -f src/autotcc.o 2>/dev/null || true
